Skip to content

fix(plugin-security): permission refusals speak the caller's language, falling back to the workspace default (#32656, 2/2) - #33290

Merged
objectstack-fleet[bot] merged 16 commits into
mainfrom
claude/area-A2-32656-refusals
Nov 14, 2026
Merged

objectstack-fleet[bot] merged 16 commits into
mainfrom
claude/area-A2-32656-refusals

Conversation

@os-elon-musk

@os-elon-musk os-elon-musk commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Elon · project thread

Fixes #32656

Stacked on #33276 (PR 1 of 2, base branch). Retarget to main once #33276 merges. The claim on #32656 names this branch.

Maintainer quick read

The refusals a permission admin or end user reads now come back in their language: request language, else workspace default, else English (ruling C on #32440). Codes, statuses and the diagnostic message are unchanged.

What changes

Why

#32656 asks every userMessage producer to compose in the request locale with the declared fallback. #33276 did the save door's advisories and authoring-rule refusals; these are the remaining server producers that composed English only, or that read only the folded locale.

Verification

  • packaged-permission-set-lock.test.ts: zh-CN, ja-JP (request wins over workspace), tlh→zh-TW workspace fallback, tlh/tlh = unstated = English; code/status/diagnostic identical in every language; the provenance-unknown refusal in de-DE.
  • permission-denied-user-copy.test.ts: de-DE request with zh-CN workspace ⇒ zh-CN sentence; ja-JP request wins; de-DE/de-DE ⇒ en.
  • mutation-listeners.test.ts: the gate receives the stated locales (empty entries dropped) and no key when none are stated.
  • meta-save-user-text-locale.test.ts (runtime, both /meta doors): the permission gate receives ['zh-CN','de'], and [] with none.
  • Local: @objectstack/plugin-security full suite 6610 passed; metadata-protocol / runtime targeted tests green; typecheck clean; test-source alias gate clean.

Clause-②: no
Metadata-protocol: none

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM

…aller's language (#32656)

Doors state userTextLocales (request locale, then workspace default) read
off the execution context, which now carries workspaceLocale unfolded.

Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
Co-Authored-By: Claude <noreply@anthropic.com>
…, falling back to the workspace default (#32656)

Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 14, 2026
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/metadata-protocol, @objectstack/plugin-security, touching 25 documentable anchor(s).

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/permissions/system-context.mdx (via registerAuthzMiddleware (symbol, a top-level function))
What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 25 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json d683e6f3af5633a5c4a13ead523e06fbeb36db75 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 2987fb0cecac3eefc48c2d8ce813d8352fb2ba9f — the merge of head 24f2148f6bc4845bde87f441164c52c71eb8f35b into base d683e6f3af5633a5c4a13ead523e06fbeb36db75, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 2987fb0cecac3eefc48c2d8ce813d8352fb2ba9f && git checkout 2987fb0cecac3eefc48c2d8ce813d8352fb2ba9f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin d683e6f3af5633a5c4a13ead523e06fbeb36db75 24f2148f6bc4845bde87f441164c52c71eb8f35b && git checkout -B drift-repro d683e6f3af5633a5c4a13ead523e06fbeb36db75 && git merge --no-ff 24f2148f6bc4845bde87f441164c52c71eb8f35b

node scripts/docs-audit/affected-docs.mjs --json d683e6f3af5633a5c4a13ead523e06fbeb36db75

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs d683e6f3af5633a5c4a13ead523e06fbeb36db75 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head 0b4a03f · 2026-11-14T15:45:40Z

review#3 (area-lease pilot #33059, area A2).

…d locales on the doors' exact request pins

The batch publish body schema is the body parser, so userTextLocales
stays a protocol-call member there, never a body key. Exact request
and execution-context key pins now name the new server-stated members.

Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
Co-Authored-By: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor

Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head fa8f2f5 · 2026-11-14T16:24:02Z

review#3.

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Review — PASS

Head: fa8f2f5d0a7bdd78250b80084ba3c9105a65322d · reviewer: review#3 (session_016WV4d1PGptBW3QRQNmy5e6) · area A2 · Fixes #32656 (PR 2 of 2, stacked on #33276 @caeb9046)

CI was not complete when read (16:24Z); the ACCEPT re-reads every check at the landing head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Review carry — PASS stands

Head: 0a2173749d429d4d75ccce0f3e178c39abef47ed · reviewer: review#3 (session_016WV4d1PGptBW3QRQNmy5e6)

The delta from my PASS at fa8f2f5d0a7bdd78250b80084ba3c9105a65322d is the merge of #33276 at fedb4843 (that test-pin commit) and nothing else. No source line moves, so the PASS (and its nits) carries to this head. The ACCEPT cites this note as Regen-provenance and re-reads every check at the landing head.

Base automatically changed from claude/project-thread-1hzwul to main November 14, 2026 21:48
…refusals

# Conflicts:
#	packages/metadata-protocol/src/protocol-publish-drafts-advisories.test.ts
#	packages/runtime/src/domains/meta-save-user-text-locale.test.ts
@objectstack-fleet

Copy link
Copy Markdown
Contributor

domain:server#5 · os-elon-musk · session_016WV4cz2MxDkQYCC4U8indM

ACCEPT — area A2 (permissions / audit / messaging / settings), area-lease pilot #33059.

Marking ready and enabling auto-merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 14, 2026 22:20
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit a1e0402 Nov 14, 2026
52 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-A2-32656-refusals branch November 14, 2026 23:39
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…ome back in the caller's language (objectstack-ai#32656, 1/2) (objectstack-ai#33276)

<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DXuamRUC67fx2TTYrFfyuSH)_

Part of objectstack-ai#32656 (PR 1 of 2; the follow-up PR objectstack-ai#33290 closes it).

## Maintainer quick read

A metadata write's advisories, and the issues of its 422 refusal, now
carry `userMessage` written in the caller's language: the request's
language, else the workspace default, else English (ruling C on objectstack-ai#32440).
`rule`, `message`, `hint`, `path` and `where` are unchanged. A rule with
no user sentence carries no `userMessage`, as before.

## What changes

- **spec (minor):** `SaveMetaItemRequestSchema` and
`PublishMetaItemRequestSchema` gain optional, server-stated
`userTextLocales` (array, max 2, ladder order); the doors build these
requests member by member, so a wire body never sets it (the `client`
precedent). `PublishPackageDraftsRequestSchema` is the batch door's body
parser, so it is unchanged: that door hands the locales to
`publishPackageDrafts` directly, and a body `userTextLocales` is not
read (pinned). `ExecutionContextSchema` gains optional
`workspaceLocale`: the workspace default on its own, because `locale`
folds the request locale and the workspace default into one value and
the ladder needs both.
- **core:** `assembleExecutionContext*` fills `workspaceLocale` from the
entry localization (never on a guest envelope). New helper
`userTextLocalesOf(ctx)` returns `[locale, workspaceLocale]`,
absent/empty values dropped.
- **metadata-protocol:** `evaluateRuntimeAuthoringGate` composes
`userMessage` per issue with `findingUserMessage(finding,
userTextLocales)` (objectstack-ai#32790's catalog). `userTextLocales` is threaded from
save, single-item publish, and the package publish promotion into the
gate (pass-through only; checked: E1's open PR objectstack-ai#33251 touches none of
these files).
- **rest / runtime doors:** `PUT /meta/:type/:name`, `POST
/meta/:type/:name/publish`, the dispatcher's `/meta` save and the
`packages` domain's publish-drafts state
`userTextLocalesOf(executionContext)`.

## Why

Ruling C on objectstack-ai#32440 (tracking objectstack-ai#32654): the producer of a finding composes
its user-facing sentence in the request locale, falling back to the
workspace default and then `en`, and every client renders it as
received. objectstack-ai#32790 shipped the catalog and the `userMessage` member (layer
1); its acceptance note 7 left this layer: compose it at the door that
knows both locales.

## Verification

- New `packages/runtime/src/domains/meta-save-user-text-locale.test.ts`,
on both `/meta` save doors (runtime dispatcher and `RestServer`) over a
real protocol and SQLite store: the stated locales are read off the
execution context (`['zh-CN','de']`, and `[]` with none); a zh-CN
request gets the `security-private-no-readscope` advisory in Simplified
Chinese while `rule`/`message`/`hint` equal the en answer; an
unsupported request locale (`tlh`) falls back to the workspace default,
then to `en`. 6/6.
- `protocol-publish-drafts-advisories.test.ts`: the package publish
hands the stated locales to the gate for every promoted draft, and none
when unstated.
- `assemble-execution-context.test.ts`: the frozen parity pins subtract
`workspaceLocale` and assert it positively (present exactly when an
authenticated principal's localization names one); new pins for the
request-locale-wins / workspace-default-kept split, the guest envelope,
and `userTextLocalesOf`.
- Exact pins updated for the new server-stated members:
`http-dispatcher.test.ts`,
`packages-publish-drafts-request-conformance.test.ts` (also: a body
`userTextLocales` is not read), `rest-exec-ctx-principal-kind.test.ts`,
`rest-server-meta-door-closed-sets.test.ts`,
`rest-server-meta-member-selector.test.ts`.
- Local: `@objectstack/metadata-protocol` full suite 22843 passed;
`@objectstack/core` security 1394 passed; spec api+kernel 3546 passed;
test-source alias gate clean; spec `check:generated`, `check:liveness`,
`check:authorable-surface`, `check:docs`, `check:strictness-ledger`,
ADR-0087 registration, changeset checks green.

Not in this PR (follow-up objectstack-ai#33290 on objectstack-ai#32656): refusal sentences written
outside the authoring rules (the packaged permission-set lock's static
English, and the permission middleware's denials, which today read only
the folded `locale`) move onto the same ladder.

Clause-②: yes
Metadata-protocol: added
Skills-docs: none — `skills/**` and `content/docs/**` teach what a
metadata author writes; `userTextLocales` and `workspaceLocale` are
stated by the server from the caller's request and workspace, never
authored or sent by a client, so no taught sentence moves. The generated
reference pages are regenerated.

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM

---------

Co-authored-by: Claude <noreply@anthropic.com>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…ave advisories and refusals (objectstack-ai#33576)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XNqdmUjc8V44JGCn8TZEDmm)_

Fixes objectstack-ai#32657

Refs objectstack-ai#33524 (console half pinned, no console change; the card stays open
for its server half)

Clause-②: yes (widening)
Metadata-protocol: none

## 维护者速读

-
改了什么:保存元数据后弹出的「提醒」以及保存被拒时的问题列表,现在显示服务端按用户语言写好的那句话(`userMessage`),不再显示给开发者看的英文
`message`/`hint`;Studio
被拒保存的提示句也直接用这句话,不再由控制台自己翻译服务端英文。服务端没写这句话的条目保持原样。另外给新建/编辑记录弹窗加了钉子测试:带
`userMessage` 的 403(中英文)显示该原因,不带的仍显示通用的「你没有权限保存此记录」。
- 为什么改:执行维护者裁决「32440 选C,32043 一起按C处理」的第 3
层:服务端(objectstack-ai#33276、objectstack-ai#33290)已按请求语言写好用户文案,控制台要直接渲染。objectstack-ai#33524 实测:弹窗本来就先读
`userMessage`,HotCRM 看到通用句是因为 plugin-security 的「需要主记录编辑权限」拒绝根本没带
`userMessage`,那是服务端的缺口,本 PR 不改服务端。
- 风险与回滚:只改控制台读哪个字段来显示;没有 `userMessage`
的条目逐字不变。`@object-ui/data-objectstack` 的 `MetadataValidationIssue`
多一个可选字段(只加不减)。回滚即 revert。
- 先看:`ui/packages/app-shell/src/providers/saveAdvisoryToast.ts` 的
`formatFinding`;`ui/packages/data-objectstack/src/metadata-error.ts` 的
`formatMetadataIssue`;`ui/packages/app-shell/src/views/studio-design/metadataError.ts`
的 `issueRefusal`。
- 两分钟验证:`pnpm --dir ui exec vitest run
packages/app-shell/src/providers/AdapterProvider.advisoryUserMessage-32657.test.tsx`,预期
3 个用例全绿,其中中文用例在真实 sonner 弹出的提醒里读到「权限集“sales_rep”的持有者只能看到……」,读不到英文
message。
- 需要你做的:无,席位落地(契约复审记录由席位补)。

## What changes

Layer 3 of tracking objectstack-ai#32654 (ruling C on objectstack-ai#32440, 「32440 选C,32043
一起按C处理」): the console renders the user-facing text the producer composed
in the request's language, with no per-code key table of its own.

- **Advisory toast** (`saveAdvisoryToast.ts`, `formatFinding`,
`@object-ui/app-shell`). An advisory finding that carries `userMessage`
(`RuntimeAuthoringIssueSchema.userMessage`, which the save and publish
doors compose since objectstack-ai#33276) renders as `[rule] where — USER_MESSAGE`, in
place of the developer-facing English `message` and `hint`. The rule id
and `where` are locators and frame both faces. A finding without one
keeps `[rule] where — message hint`. The module header now says which
prose is shown.
- **The one issue reader** (`metadata-error.ts`, `formatMetadataIssue`,
`@object-ui/data-objectstack`). A 422 issue with `userMessage` renders
`• path — USER_MESSAGE`; one without keeps `• path — message`.
`formatMetadataError` and app-shell's `formatPublishFailures` both write
issues through it, so the banners, the field designer's refusal and the
publish-failure list follow.
- **Studio's refusal sentence** (`metadataError.ts`, `issueRefusal`).
When the issue carries `userMessage`, the sentence's problem part is
that text verbatim; only an issue without one has its English `message`
read through `translateValidationMessage`, the console's own table. This
is the console-side translation of server prose the ruling retires where
the producer speaks.
- **Type** (`metadata-client.ts`). `MetadataValidationIssue` gains
optional `userMessage`, typed `RuntimeAuthoringIssue['userMessage']`
from `@objectstack/spec/api`, so a rename in the spec stops it
compiling. Published interface, optional member: `Clause-②: yes
(widening)`.
- **Changeset** `.changeset/32657-console-localized-user-text.md`:
`@object-ui/app-shell`, `@object-ui/console`,
`@object-ui/data-objectstack` patch, with both declaration lines.

The presence test is the same predicate in all three readers (a
non-empty string after trimming, the rule `@objectstack/client` applies
when it lifts `userMessage`). `declaredUserMessage` (`@object-ui/react`)
is the one reader of an API ERROR's marking; it was not reused here
because a finding element is not an error, `@object-ui/data-objectstack`
sits below `@object-ui/react` (no import that way), and
`saveAdvisoryToast.ts` imports nothing that renders by design.

## Why

- **objectstack-ai#32657** reproduced on `origin/main` `e3f0cfd4`: the toast never
read `advisories[].userMessage`, `formatMetadataIssue` never read
`issues[].userMessage`, and `issueRefusal` translated the English
`message` console-side.
- **objectstack-ai#33524** did not reproduce in the console. The console's New and
Edit buttons open `ModalForm` (app-shell `console/AppContent.tsx`),
which rethrows a refused write into the components form renderer; its
refusal reader takes `declaredUserMessage(error)` before the fixed
`form.noPermissionToSave` line, as do `FormPage.tsx`'s `refusalText` and
the edit OCC path (`occSave.tsx`). The master-edit refusal reaches the
console with no `userMessage`: plugin-security's `masterEditDenied`
(`security-plugin-cbp-write-gate.ts`) throws a bare
`PermissionDeniedError` whose `message` is the developer sentence
"requires edit access to its master record", and objectstack-ai#33290 localized other
refusals, not this one. So the generic line is the correct reading of
what the server sends, and acceptance 1 and 2 of objectstack-ai#33524 need the
producer to compose a localized `userMessage` naming the master. That is
a server change this PR does not make; the card stays open for it (seat
ruling in the card thread).

## Tests

- New `AdapterProvider.advisoryUserMessage-32657.test.tsx` (rendered end
to end): the real `AdapterProvider` builds the real adapter, the real
SDK client parses a save response from a `fetch` double, and the real
sonner `Toaster` draws the toast; the assertions read the toast's text
on screen.
- a zh-CN `userMessage` (the `security-private-no-readscope` catalog
sentence for these params) shows, with the rule id, and neither the
English `message` nor `hint` shows;
  - an en `userMessage` shows the same way;
  - CONTROL: a finding without one keeps `message` + `hint` + rule.
- `saveAdvisoryToast.test.ts`: two cases added (the exact line with a
`userMessage`; CONTROL: a blank one is no sentence).
- New `metadataError.issueUserMessage-32657.test.ts`:
`formatMetadataIssue` with and without `userMessage`;
`formatMetadataError` and `formatPublishFailures` carry it;
`flowSaveRefusal` (through `issueRefusal`) carries a zh `userMessage`
verbatim and not the console's translation, and CONTROL: an issue
without one keeps the console's reading.
- New `ModalForm.markedRefusal-33524.test.tsx` (rendered; the dialog the
console's New and Edit buttons open): the user types and presses the
dialog's own Create or Update button, the data source refuses with a 403
shaped as the ObjectStack adapter throws it.
- create and edit, each with an en and a zh-CN `userMessage`: the
sentence shows, the generic line does not, the developer `message` does
not;
- CONTROL, create and edit: a 403 with no `userMessage` shows the
generic line and withholds the developer `message`.

<details><summary>Red-first on base, and ablations</summary>

- **Base.** The four production files checked out at `e3f0cfd4` (tree
only), the new and edited tests kept: Test Files 3 failed, 1 passed (4);
Tests 6 failed, 26 passed (32). The six reds are exactly the
`userMessage` cases of the three objectstack-ai#32657 files; the controls passed.
`ModalForm.markedRefusal-33524.test.tsx` passed on base, 6 of 6: the
objectstack-ai#33524 console half does not reproduce. Restored with `git checkout HEAD
--`, `git diff HEAD` empty.
- **Ablations** through `scripts/ablation-replace.mjs`, each restored to
the HEAD blob with `git diff HEAD` empty. ui vitest reads `@object-ui/*`
from source, so no build sits between mutation and run.
- A1 `formatFinding`'s `userMessage` branch made unreachable: Tests 3
failed, 18 passed; the reds are the two rendered `userMessage` cases and
the unit case; both controls green.
- A2 `formatMetadataIssue` made to read `message` always: Tests 2
failed, 3 passed.
- A3 `issueRefusal`'s `userMessage` branch made unreachable: Tests 1
failed, 4 passed.
- A4 (the objectstack-ai#33524 pin's bite) the form renderer's refusal reader made to
answer the generic line for any permission error before
`declaredUserMessage`: Tests 4 failed, 2 passed; the four marked cases
red, the two CONTROLs green. The first A4 attempt passed a two-line
anchor and was refused before running anything; it was rerun with a
one-line anchor.

</details>

## Acceptance notes

- **objectstack-ai#33524 is referenced, not closed.** Its console half is pinned with
no console change (above). Its producer half, plugin-security's
master-edit refusal composing a localized `userMessage` that names the
master, is reported to the seat as a server finding; the seat re-lanes
the card.
- **objectstack-ai#32440's post-save advisory half** is met by this PR: the advisory
toast now renders the producer's localized sentence wherever the save
door sends one. Rules the producer has written no sentence for still
show their English `message` and `hint`, as the contract declares (the
remaining catalogue is tracked on objectstack-ai#32835).
- **objectstack-ai#32043's member-limit sentence** is not met by this PR: that refusal
(`DEVELOPER_ORGANIZATION_MEMBER_LIMIT_REACHED`) is produced by cloud. If
cloud sends it with a `userMessage`, the invite dialog's reader decides
what shows; this PR did not measure that dialog.
- **Other write-error readers.** Several console surfaces read a write
error through `extractWriteErrorMessage` alone (for example the
sharing-rule clone dialog and the position and assigned-user sections),
which reads the server's `error` / `message` and not `userMessage`.
Noted, not changed here: outside this card's declared surface.
- **File surface:** as declared to the seat (the four production files
above, their tests, one new plugin-form test, the changeset). No i18n
key, no `FormPage.tsx` or `flowResponse.ts` edit, no server, spec or
cloud change.

## Verification

Run on head `e0302529` (base `origin/main` `e3f0cfd4`).

<details><summary>Build, tests, type-check and lint</summary>

- Builds under the verify lock: `pnpm --workspace-concurrency=2 --filter
'@objectstack/spec...' --filter '@objectstack/formula...' --filter
'@objectstack/client...' --filter '@objectstack/lint...' --filter
'@objectstack/sdui-parser...' build` (VERDICT command-exit 0), then
`pnpm --workspace-concurrency=2 --filter '@object-ui/app-shell^...'
build` (VERDICT command-exit 0).
- The four new or edited test files: Test Files 4 passed (4), Tests 32
passed (32).
- Neighbouring suites, `pnpm --dir ui exec vitest run --maxWorkers=2
packages/data-objectstack/ packages/app-shell/src/providers/
packages/app-shell/src/views/studio-design/
packages/plugin-designer/src/MetadataFieldsPage.refusalIssues-11302.test.tsx
packages/plugin-form/src/ModalForm
packages/components/src/__tests__/form-write-error-message.test.tsx`:
Test Files 499 passed (499), Tests 4343 passed (4343).
- Type-check, each VERDICT command-exit 0: `pnpm --filter
@object-ui/data-objectstack run type-check` (`tsc --noEmit`), `pnpm
--filter @object-ui/app-shell run type-check` and `pnpm --filter
@object-ui/plugin-form run type-check` (both `tsc --noEmit && tsc -p
tsconfig.test.json`, so the new test files are compiled).
- eslint on the eight changed files: 0 errors (8 warnings, all
pre-existing `no-explicit-any` lines in `metadata-client.ts`). `pnpm
--dir ui run check:new-line-citations`: 0 new citations.

</details>

<details><summary>Derived gates (37)</summary>

`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 37 families on `e0302529`. All 37
exited 0. `pnpm --dir ui exec vitest run scripts/` was SIGKILLed in the
loop while a 23-minute suite run held the box; rerun alone under the
lock with `--maxWorkers=2`: Test Files 171 passed, 2 skipped (173), exit
0. `--ran` reconciliation: 37 derived, 37 run, 0 NOT-MEASURED. Changed
lines: 446, under the 3,000 threshold. No dogfood battery: no `!` in the
title and no `(narrowing)` arm.

</details>

## Human Minimum

- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.

Development by the card thread `session_01FEkQ5m1xDT63aCaQJNjwXD` for
the seat `domain:ui#2`.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5m1xDT63aCaQJNjwXD)_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01FEkQ5m1xDT63aCaQJNjwXD

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

server: userMessage producers and the save door compose user-facing text in requestLocale (ruling C on #32440, layer 2)

2 participants